﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using KBManagement.DAL;
using KBManagement.Library;
namespace KBManagement.BIZ
{
    class AdminFacade : FacadeBase<Admin>
    {
        public override IQueryable Select()
        {
            throw new NotImplementedException();
        }

        public override Admin[] SelectEntities()
        {
            throw new NotImplementedException();
        }

        public override Admin Find(object id)
        {
            throw new NotImplementedException();
        }

        public override Admin[] FindMany(object id)
        {
            throw new NotImplementedException();
        }
        public Admin Login(string username, string pass)
        {
            try
            {
                return Utils.CreateInstance().GetDBContext().Admins.Single(x => x.UserName.ToUpper().Equals(username.ToUpper()) && x.Pass.Equals(pass));
            }
            catch (Exception ex)
            {
                return null;
            }

        }
    }
}
